//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/4/15.
//
#include <stdio.h>
#include <math.h>
int fun01(int i){
    int j,flag;
    for(j=2;j<=sqrt(i);j++){
        flag=0;
        if(i%j==0){
            flag=1;
            break;
        }
    }
    if(flag==0){
        return 1;
    } else{
        return 0;
    }
}
int fun02(int x,int *v,int n){//v为指针
    int left=0,right=n-1,mid;
    while(left<=right){
        mid = (left+right)/2;
        if(x>v[mid]){
            left = mid + 1;
        } else if(x<v[mid]){
            right = mid - 1;
        }else{
            return mid;
        }
    }
    if(left>right){
        return -1;
    }
}
int main(){
    int num01,num02,arr[10]={0,1,2,3,4,5,6,7,8,9},len;
    scanf("%d",&num01);
    printf("%d\n",fun01(num01));
    scanf("%d",&num02);
    len = sizeof (arr)/sizeof(arr[0]);
    printf("%d", fun02(num02,arr,len));//此处arr是数组首元素的地址
    return 0;
}